<!--
@WIN-ALLOW:xml-roles:*
@WIN-ALLOW:IA2_STATE_MODAL
@BLINK-ALLOW:modal*
@AURALINUX-ALLOW:modal
-->
<!DOCTYPE html>
<html>
<body onload="loaded()">
  <div role="dialog">Nonmodal</div>
  <div role="dialog" aria-label="modal dialog" aria-modal="true">
    <span>Modal</span>
    <button id="focusMe">Focus Me</button>
  </div>
  <script>
    // On many platforms, the aria-modal state is exposed as a property which
    // ATs choose how to interpret. However, on other platforms,
    // aria-modal=true requires the accessibility tree to be pruned of all
    // content other than the modal dialog and it's descendants.
    //
    // To avoid uneccessary work, the pruning only occurs when the dialog
    // becomes "active", via a select or focus event occuring within a visible
    // element with the role of dialog or alertdialog, and aria-modal=true.
    //
    // To test the pruning logic on the relevant platform, a focus event is
    // fired within the dialog element after loading.
    function loaded() {
      focusMe.focus();
    }
  </script>
</body>
</html>
